<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>字幕弹幕唱歌检测</title>
    <style>
      body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
        line-height: 1.6;
        color: #333;
        max-width: 800px;
        margin: 40px auto;
        padding: 0 20px;
        background-color: #f8f9fa;
      }
      h1,
      h2 {
        color: #007bff;
      }
      .container {
        background-color: #fff;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
      }
      .upload-section {
        margin-bottom: 20px;
        border: 1px solid #ddd;
        padding: 15px;
        border-radius: 5px;
      }
      label {
        display: block;
        font-weight: bold;
        margin-bottom: 8px;
      }
      input[type="file"] {
        margin-bottom: 15px;
      }
      button {
        background-color: #007bff;
        color: white;
        padding: 12px 20px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 16px;
        width: 100%;
      }
      button:hover {
        background-color: #0056b3;
      }
      .result {
        margin-top: 30px;
        background-color: #e9ecef;
        padding: 20px;
        border-radius: 5px;
        white-space: pre-wrap;
        font-family: "Courier New", Courier, monospace;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <h1>字幕弹幕唱歌检测</h1>
      <p>
        请上传字幕文件或弹幕文件 (SRT,
        VTT，LRC，TXT)，系统将分析其中可能包含唱歌的片段。
      </p>

      <form method="post" enctype="multipart/form-data">
        <div class="upload-section">
          <label for="subtitle_files">1. 上传字幕文件 (选填)</label>
          <input
            type="file"
            name="subtitle_files"
            id="subtitle_files"
            multiple
          />
        </div>

        <div class="upload-section">
          <label for="barrage_files">2. 上传弹幕文件 (选填)</label>
          <input type="file" name="barrage_files" id="barrage_files" multiple />
        </div>

        <button type="submit">开始分析</button>
      </form>

      {% if result %}
      <div class="result">
        <h2>分析结果：</h2>
        <p>{{ result }}</p>
      </div>
      {% endif %}
    </div>
  </body>
</html>
